<%@ page contentType="text/html;charset=UTF-8"%>
<jsp:directive.include file="/WEB-INF/view/jsp/admin/includes/top.jsp" />
<script type="text/javascript">
	$(document).ready(function() {
		$.formValidator.initConfig({formid:"inputForm"});
		$("#name").formValidator({onshow:"20个字符以内",onfocus:"20个字符以内"})
		.inputValidator({min:1, max:20,onerror:"名称的长度应在20个字符以内"});
		$("#title").formValidator({onshow:"20个字符(汉字10个)以内",onfocus:"20个字符(汉字10个)以内"})
		.inputValidator({min:1, max:20,onerror:"标题的长度应在20个字符(汉字10个)以内"});
	});
</script>
<h3>
	编辑积分类型
</h3>
<form id="inputForm" name="inputForm"
	action="${ctx}/admin/creditType!save.do" method="post"
	enctype="multipart/form-data">
	<input type="hidden" name="id" value="${creditType.id}" />
	<table class="inputView">
		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				积分类型名称：
			</td>
			<td class="value" valign="middle">
				<input type="text" id="name" name="name" style="width: 180px;"
					value="${creditType.name}" />
			</td>
			<td>
				<div id="nameTip"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				积分标题：
			</td>
			<td class="value" valign="middle">
				<input type="text" id="title" name="title" style="width: 180px;"
					value="${creditType.title}" />
			</td>
			<td>
				<div id="TitleTip" style="width: 250px"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				是否有效：
			</td>
			<td class="value" valign="middle">
				<input class="radio" type="radio" id="available" name="available"
					value="1"
					<c:if test="${creditType.available }">
								checked="checked"
							</c:if>>
				是
				</input>
				<input class="radio" type="radio" id="available" name="available"
					value="0"
					<c:if test="${!creditType.available }">
								checked="checked"
							</c:if>>
				否
				</input>

			</td>
			<td>
				<div id="typeTip" style="width: 250px"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				积分图标：
			</td>
			<td class="value" valign="middle">
				<input type="hidden" name="image" value="${creditType.image}" />
				<input type="file" name="iconfile" id="iconfile"
					ContentEditable="false" onpaste="return false"
					onkeypress="return false" oncontextmenu="return false;"
					ondragenter="return false" />

			</td>
			<td>
				<div id="typeTip" style="width: 250px">
					(*如不修改积分图标，则此项不填写即可)
				</div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				积分单位：
			</td>
			<td class="value" valign="middle">
				<input type="text" id="unit" name="unit" style="width: 180px;"
					value="${creditType.unit}" />
			</td>
			<td>
				<div id="typeTip" style="width: 250px"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				积分兑换比率：
			</td>
			<td class="value" valign="middle">
				<input type="text" id="ratio" name="ratio" style="width: 180px;"
					value="${creditType.ratio}" />
			</td>
			<td>
				<div id="typeTip" style="width: 250px"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				初始积分：
			</td>
			<td class="value" valign="middle">
				<input type="text" id="initValue" name="initValue"
					style="width: 180px;" value="${creditType.initValue}" />
			</td>
			<td>
				<div id="typeTip" style="width: 250px"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				允许兑出：
			</td>
			<td class="value" valign="middle">
				<input class="radio" type="radio" id="allowExchangeOut"
					name="allowExchangeOut" value="1"
					<c:if test="${creditType.allowExchangeOut }">
								checked="checked"
							</c:if>>
				是
				</input>
				<input class="radio" type="radio" id="allowExchangeOut"
					name="allowExchangeOut" value="0"
					<c:if test="${!creditType.allowExchangeOut }">
								checked="checked"
							</c:if>>
				否
				</input>
			</td>
			<td>
				<div id="typeTip" style="width: 250px"></div>
			</td>
		</tr>

		<tr>
			<td class="label" width="15%" align="right" valign="middle">
				允许兑入：
			</td>
			<td class="value" valign="middle">
				<input class="radio" type="radio" id="allowExchangeIn"
					name="allowExchangeIn" value="1"
					<c:if test="${creditType.allowExchangeIn }">
								checked="checked"
							</c:if>>
				是
				</input>
				<input class="radio" type="radio" id="allowExchangeIn"
					name="allowExchangeIn" value="0"
					<c:if test="${!creditType.allowExchangeIn }">
								checked="checked"
							</c:if>>
				否
				</input>
			</td>
			<td>
				<div id="typeTip" style="width: 250px"></div>
			</td>
		</tr>



		<tr>
			<td class="label" width="15%" align="right" valign="middle">
			</td>
			<td class="value" valign="middle">
				<input type="submit" id="submitConfig" name="submitConfig"
					value="确认" />
				&nbsp;
				<input type="button" value="取消" onclick="history.back()" />
			</td>
		</tr>
	</table>
</form>
<jsp:directive.include
	file="/WEB-INF/view/jsp/admin/includes/bottom.jsp" />